//引入http组件
let http=require('http');

//创建服务器const { close } = require('inspector');
let server=http.createServer((req , res ) => {
   
    console.log( req.url)
    if(req.url == '/favicon.ico'){
         return;
    }  //中文乱码解决
        res.setHeader('Content-Type','text/html;charset=utf-8');        
            if(req.url == '/favicon.ico'){
                return;
            }else if(req.url == '/'){
                res.end('ok');
            }else if(req.url == '/index'){
                res.end('首页');
            }else if(req.url == '/login'){
                res.end('登录界面');
            }else if(req.url == '/registe'){
                res.end('注册界面');
            }else if(req.url == '/product'){
                res.end('产品列表');
            }else if(req.url == '/order'){
                res.end('订单列表');
            }
        
   
            res.end('2022冬奥会如期在北京举行')

});
//绑定监视器
server.listen(80,'www.274.com',()=>{
    console.log('2022北京冬奥会');
});